<template>
  <div style="width: 1200px;margin: 0 auto;">
    <el-row :gutter="10">
      <el-col :span="4">
        <el-menu router active-text-color="#ffd04b"
                 background-color="#545c64"
                 text-color="#fff">
          <el-sub-menu index="1">
            <template #title>
              <el-icon>
                <Menu/>
              </el-icon>
              <span>我的信息</span>
            </template>
            <el-menu-item index="/patient/information"
                          class="menuI" :id="($route.path==='/patient/information')?'menuC':''">
              信息
            </el-menu-item>
            <el-menu-item index="/patient/changePatient"
                          class="menuI" :id="($route.path==='/patient/changePatient')?'menuC':''">
              修改个人信息
            </el-menu-item>
          </el-sub-menu>
          <el-sub-menu index="2">
            <template #title>
              <el-icon>
                <location/>
              </el-icon>
              <span>我的预约记录</span>
            </template>
            <el-menu-item  index="/patient/appointment"
                          class="menuI" :id="($route.path==='/patient/appointment')?'menuC':''">
              预约记录
            </el-menu-item>
            <el-menu-item index="/patient/newAppointment"
                          class="menuI" :id="($route.path==='/patient/newAppointment')?'menuC':''">
              新建预约
            </el-menu-item>
          </el-sub-menu>
        </el-menu>
      </el-col>
      <el-col :span="20">
        <router-view/>
      </el-col>
    </el-row>
  </div>
</template>

<script setup>

import {
  Menu,
  Location
} from "@element-plus/icons-vue";

</script>

<style scoped>
.menuI {
  width: 190px;
  height: 60px;
  padding-left: 20px!important;
  padding-right: 0;
  line-height: 100px;
  font-size: 24px;
  color: black;
  transition: all 0.5s ease-in-out;
  transition-delay: 0.1s; /* 添加延迟 */
}

.menuI.is-active {
  width: 170px;
  height: 40px;
  margin-left: 20px;
  margin-top: 10px;
  margin-bottom: 10px;
  border-radius: 50px 0 0 50px;
  background-color: rgba(255, 255, 255, 0.9);
}

#menuC {
  width: 170px;
  height: 40px;
  margin-left: 20px;
  margin-top: 10px;
  margin-bottom: 10px;
  border-radius: 50px 0 0 50px;
  background-color: rgba(255, 255, 255, 0.9);
}
</style>